package co.edu.unal.geditor.view.tools;

import java.awt.Point;

import co.edu.unal.geditor.controller.App;
import co.edu.unal.geditor.model.Drawing;
import co.edu.unal.geditor.model.GraphElement;

public abstract class CreationTool extends Tool
{

	public abstract GraphElement createObject( Point ptPressed, Point ptReleased );

	// template method design pattern
	@Override
	public void processMouseReleased( Point ptReleased )
	{
		GraphElement ge = createObject( m_ptPressed, ptReleased );
		if ( ge != null )
		{
			Drawing doc = App.getInstance().getDrawing();
			doc.addElement( ge );
		}
	}
}
